package com.lightsaber.trade.core.common.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.UIBean;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;

import com.opensymphony.xwork2.util.ValueStack;

/**
 * Convert code to label
 * 
 * @author LiuJian
 * 
 */
@StrutsTag(name = "code2label", tldTagClass = "com.lightsaber.trade.core.common.tag.Code2Label", description = "code2label")
public class Code2Lebel extends UIBean {

    public Code2Lebel(final ValueStack stack, final HttpServletRequest request,
            final HttpServletResponse response) {
        super(stack, request, response);
    }

    private String label;

    @Override
    @StrutsTagAttribute(description = "set label", type = "String")
    public void setLabel(final String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    @Override
    protected String getDefaultTemplate() {
        // 得到模板名,即 src/main/resources/template/simple/page.ftl
        return "code2label";
    }

}
